package glemipsc;

import glemipsc.implementations.Argument;

public class TranslatedAddress extends Address {
	private Address original;
	private int offset;
	
	public TranslatedAddress(Address original, Argument reg, int offset) {
		super(reg, offset);
		this.original = original;
		this.offset = offset;
	}
	
	public Argument getOffset() {
		return GLEMipsC.compiler.getEnvironment().implementation.getImmediate(this.getValue());
	}
	
	public int getValue() {
		return original.getValue() + this.offset;
	}

}
